<?php

namespace App\Http\Controllers\Home;

use App\Http\Controllers\Controller;
use App\Models\Ecology;
use App\Models\Offer;
use App\Models\Product;
use App\Models\Seo;
use Illuminate\Http\Request;

class EcologyController extends Controller {

    public function index(Request $request){
        $seo = Seo::getSeo(9);
        $all = Ecology::where('status',Ecology::STATUS_1)->orderBy('id','asc')->get()->toArray();
        $ecologys = [];
        foreach ($all as $key => $ecology){
            $ecologys[$ecology['cid']][] = $ecology;
        }
        return view('home.ecology.index',compact('seo','ecologys'));
    }

}
